<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>SchemeScript - Content Assist</title>
    <link href="schemescript.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1>Content Assist</h1>

<p>
	<i>Content Assist</i> is a general concept encompassing:
</p>
<ul>
	<li>Code completion,</li>
	<li>Text hover, and</li>
	<li>Contextual information.</li>
</ul>
<p>
	All of these features are supported by SchemeScript. 
</p>

<h2>How this works</h2>
<p>
	At startup time, SchemeScript populates a dictionary (symbol table) with all
	the top-level definitions found in all Scheme source files
	found in the current workspace (files with the extension <code>.scm</code>).
	This dictionary contains information on the
	source location of the various definitions, a description of the
	definition (is it a variable? a function? syntax? etc.). 
</p>
<p>
	Also, each time a file is saved, the dictionary is updated to reflect the
	changes.
</p>

<h2>Customization</h2>
<p>
	The set of top-level forms that are recognized by the editor for content
	assist purposes can be adapted to the user's needs.	By default, all
	Scheme forms are recognized, as well as some <a href="http://www.gnu.org/software/kawa">Kawa</a>
	extensions, like module forms, class definitions, record (SRFI-9) definitions, etc.
</p>
<p>
	To add (or remove) forms supported, the file <code>conf/forms.scm</code>, found in 
	the plug-in directory, must be edited. 
</p>
<p>
	To add a supported form, simply add a call to the SchemeScript function <code>define-form-processor</code>.
	The first argument must be a symbol (the name of the supported form), while the second
	argument is a <code>lambda</code>-expression called to process top-level forms
	beginning with the specified symbol. This <code>lambda</code>-expression must 
	accept 4 parameters (the dictionary, the matched form, the Eclipse resource 
	containing the form, and the line number of the form), and is responsible for
	populating the dictionary by calling the <code>add-entry!</code> procedure
	(defined at the beginning of <code>conf/forms.scm</code>).
</p>
<p>
	Here is an example for the <code>define-syntax</code> special form:
</p>
<pre>
(define-form-processor
 '<b>define-syntax</b>
 (<b><span style="color: blue">lambda</span></b> (dictionary form resource line-number)
   (<b><span style="color: blue">when</span></b> (<b><span style="color: blue">and</span></b> (pair? (cdr form))
              (symbol? (cadr form)))
     (<b><span style="color: blue">let*</span></b> ((name        (cadr form))
            (description (format #f "~a - user syntax" name)))
       (add-entry! dictionary name description 'syntax resource line-number)))))	
</pre>


<hr/>
<p>
	Copyright (C) 2004-2006 <b>Dominique Boucher</b>.
</p>
</body>
</html>